package com.fth.learn.chapter04;

/**
 * 数列
 * YiMi
 *
 * @author YiMi
 * @version 1.0
 * @date 2023/5/27 14:38
 */

public class FBNQ {

    public static void main(String[] args) {
        int start = 1;
        int second = 1;

        System.out.println(start+"\t");
        System.out.println(second+"\t");
        int index = 0;
        while (index++ < 18){
            int t = start + second;
            System.out.println(start + second + "\t");
            start = second;
            second = t;
        }
    }
    /**
     * 递归
     */
    public static int fibonacci(int a ){
        int num = 0;
        if(a==1 || a==2){
            num = 1;
            return num;
        }else{
            return fibonacci(a - 1) + fibonacci(a - 2);
        }
    }
}
